<!-- 我的文章 -->
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>焦点学苑</title>
    <link rel="stylesheet" href="/css/base.css">
    <link rel="stylesheet" href="/css/style.css">
    <script type="text/javascript" src="js/vue3.js"></script>
</head>
<script>
    function changeto (url) {
        window.location.href = url;
    }
</script>

<body>
    <div class="head-box">
        <div class="head wrap">
            <div class="logo fl"><a href=""><img src="/images/logo.png"></a></div>
            <div class="head-right fr">
                <div class="head-a fr">
                    <div class="head-a1 fl"><a href=""><img src="/images/tb-a.png"></a></div>
                    <div class="head-a1 fl"><a href=""><img src="/images/tb-b.png"></a></div>
                    <span th:unless="${not #strings.isEmpty(session.u?.getUid())}">
                        <div class="head-a3 login-click fl"><a href="#">登录</a></div>
                        <div class="head-a4 fl"><a href="/register.html" target="blank">注册</a></div>
                    </span>
                    <span th:if="${not #strings.isEmpty(session.u?.getUid())}">
                        <select name="" id="" class="head-a3" onchange="changeto($(this).val())">
                            <option value="" checked>我的</option>
                            <option value="/article-add.html"><a href="/blog/user/add.to"> 发表文章</a></option>
                            <option value="/ainArticleList"><a>我的作品</a></option>
                            <option value="/userConcernList"><a>我的收藏</a></option>
                        </select>
                        <a href="/logout">
                            <div class="head-a4 reg-click fl">注销</div>
                        </a>
                    </span>

                </div>
                <div class="clearfix"></div>
                <div class="nav fr">
                    <ul>
                        <li class="nav-cut"><a href="/">首页</a></li>
                        <li><a href="/blog/user/article.to">文章</a>
                            <!-- <div class="sub-nav">
                                <div class="bich-top"></div>
                                <div class="bich">
                                    <a href="">服饰</a>
                                    <a href="">美食</a>
                                    <a href="">出行</a>
                                    <a href="">约会</a>
                                </div>

                            </div> -->
                        </li>
                        <li><a href="/course/courseList">课程</a></li>
                        <li><a href="#">活动</a></li>
                        <li><a href="#">联系我们</a></li>

                    </ul>
                </div>
                <div class="clearfix"></div>
            </div>
        </div>
    </div>


    <div class="content">
        <div class="col-height"></div>
        <div class="focus-banner">
            <div class="wrap">
                <div class="focus-a1"><img src="/upload/focus-a2.png"></div>
                <div class="focus-a2"><a th:text="${session.u.uname}">的文章</a></div>
            </div>
        </div>
        <div class="focus-b-box">
            <div class="focus-list">
                <div class="focus-title">[[${session.u?.uname}]]</div>
            </div>
            <div class="coll-box">
                <ul class="col-ul" id="col-ul">
                </ul>
            </div>
            <div class="more"><a id="selArt" onclick="pageTo($(this).attr('selAtr'))">查看更多</a></div>
        </div>
    </div>

    <div class="footer">
        <div class="wrap">
            <div class="foot">
                <div class="foot-left fl">
                    <a href="">关于我们</a>
                    <a href="">加入我们</a>
                    <a href="contact.html">联系我们</a>
                    <a href="">媒体采访</a>
                </div>
                <div class="foot-c fl"><a href=""><img src="/images/foot-logo.jpg"></a></div>
                <div class="foot-right fr">
                    <a href="">同城活动</a>
                    <a href="">课程资讯</a>
                    <a href="">最新发布</a>
                    <a href="">热门文章</a>
                </div>
            </div>
            <div class="foot-btm">网页制作by云邦</div>
        </div>
    </div>


    <!--登录注册弹窗-->
    <div class="mask"></div>
    <div class="login">
        <div class="login-title">
            <div class="login-a">登录</div>
            <div class="login-b"></div>
            <div class="login-c close">x</div>
        </div>
        <div class="login-btm">
            <div class="login-d"><input type="text" class="login-text" placeholder="注册时填写的邮箱"></div>
            <div class="login-d"><input type="password" class="login-pas" placeholder="密码"></div>
            <div class="login-d"><input type="button" class="login-btn" placeholder="登录"></div>
            <div class="login-f">
                <a href="">忘记密码</a>
                <span>还没有焦点账号?><a href="javascript:;" class="reg-href">点击注册</a></span>
            </div>
        </div>
    </div>

    <div class="reg">
        <div class="login-title">
            <div class="login-a">注册</div>
            <div class="login-b"></div>
            <div class="login-c close">x</div>
        </div>
        <div class="login-btm">
            <div class="login-d"><input type="text" class="login-text" placeholder="邮箱/手机号"></div>
            <div class="login-d"><input type="password" class="login-pas" placeholder="密码"></div>
            <div class="login-d"><input type="button" class="login-btn" placeholder="注册"></div>
            <div class="login-f">
                <a href="">忘记密码</a>
            </div>
        </div>
    </div>

    <script src="/js/jquery-1.11.1.min.js"></script>
    <script src="/js/Action.js"></script>
    <script>
        $(".pyl").click(function () {
            $(this).find(".tbq").slideToggle()
        })
        function selectArticle (aid) {
            window.location.href = "/blog/user/comment?aid=" + aid;
        }
        function coll (aid) {
            $.getJSON("/blog/user/collect?aid=" + aid, function (data) {

                alert(data)
            })

        }

        function pageTo (pageNum) {
            if (pageNum != 0) {
                $.getJSON("/blog/user/ainarticle?pageNum=" + pageNum, function (data) {
                    $.each(data.pages.list, function (i, item) {

                        str = "<li th:each=\"cl:${articleList.getList()}\">\n" +
                            "          <div class=\"col-list\">\n" +
                            "            <div class=\"col-a fl\"><img src=\"/img/" + item.artimg + "\"></div>\n" +
                            "            <div class=\"col-b fl\">\n" +
                            "              <div class=\"col-b1\"><a>" + item.title + "</a></div>\n" +
                            "              <div class=\"col-b2\"><img src=\"/upload/col-b.jpg\">" + item.blogusers.uname + "<span>" + item.createtime + "</span>\n" +
                            "              </div>\n" +
                            "              <div class=\"col-b3\">" + item.content + "</div>\n" +
                            "            </div>\n" +
                            "            <div class=\"col-c\">\n";
                        if (item.astatus == 1) {
                            str += "<span><span><img src=\"/images/col-c1.jpg\"   onclick=\"selectArticle(" + item.aid + ")\">" + item.commentnum + "</span>\n" +
                                "                   <span><img src=\"/images/col-c2.jpg\"   onclick=\"coll(" + item.aid + ")\" >" + item.collnum + "</span>\n" +
                                "                 <em><img src=\"/images/col-c3.jpg\"></em>\n" +
                                "                 <em><img src=\"/images/col-c4.jpg\"></em>\n" +
                                "                 <em><img src=\"/images/col-c5.jpg\"></em>\n" +
                                "\n" +
                                "               </span>\n"
                        }

                        if (item.astatus == 0) {
                            str += "  <span>\n" +
                                "                   <span><a>评语</a></span>\n" +
                                "                   <span><a style='color:red'></a></span>\n" +
                                "              <span><a>文章状态</a></span><span><a ></a><a style=\"color: red\">审核中</a></span></span>\n";
                        }
                        else if (item.astatus == -1) {
                            str += "<span>\n" +
                                "                   <span><a>评语</a></span>\n" +
                                "                   <span><a style='color:red'>" + data.cmList[item.aid].title + "</a></span>\n" +
                                "              <span><a>文章状态</a></span>  <span><a ></a><a className=\"head-a3\"   href='/blog/user/update.to?aid=" + item.aid + "' >已驳回去修改</a></span></span>\n";
                        }
                        str += "</div></div></li>";
                        $("#col-ul").append(str);


                    })
                    $("#selArt").attr("selAtr", data.pages.nextPage)
                })
            }


        }
        pageTo(1)


    </script>

</body>

</html>